package com.chj.listeners;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
public class TestListener {

	protected final Logger logger = LoggerFactory.getLogger(this.getClass());

	@KafkaListener(topics = { "test" }, group = "test-group1")
	public void listen(ConsumerRecord<?, ?> record) {
		logger.info("kafka Consumer -----------> topic: {}, key: {},  value: {}", record.topic(), record.key(), record.value().toString());
	}

}
